{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">谈合作列表</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"
                   data-auth-add="{:$auth->check('access/add')}"
                   data-auth-edit="{:$auth->check('access/edit')}"
                   data-auth-delete="{:$auth->check('access/del')}"></table>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/html" id="picTpl">
    <img style="max-width:80px; max-height:30px;" src="{{d.img_url}}" data-image="{{d.name}}">
</script>


<script type="text/html" id="barTool">

    <a class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={{ d.id }}' data-title="查看"
       data-full="true">查看</a>

    <a href='{:url("del",["catid"=>$catid])}?ids={{ d.id }}'
       class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>


</script>

<script type="text/html" id="statusTpl">
    <input type="checkbox" name="status" data-href='{:url("setstate")}?id={{d.id}}' value="{{d.id}}"
           lay-skin="switch"
           lay-text="启动|关闭" lay-filter="switchStatus" {{ d.status==1 ? 'checked' : '' }}>
</script>

<script type="text/javascript">
    layui.use('yznTable', function () {
        var table = layui.yznTable;
        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: '{:url("add")}',
            edit_url: '{:url("edit")}',
            delete_url: '{:url("del")}',
        };
        table.render({
            init: init,
            // toolbar: ['refresh', 'add'],
            toolbar: ['refresh'],
            url: '{:url("index")}',
               // search: false,
            cols: [
                [
                    //名称 水票背景图 所属商品分类 所属商品

                    {field: 'id', width: '8%', align: "center", title: 'ID'},
                    {field: 'nickname', align: "center", width: '15%', title: '咨询会员', search:false},
                    {field: 'mobile', align: "center", width: '15%', title: '会员电话', search:false},
                    {field: 'name', align: "center", width: '15%', title: '单位/个人名称'},
                    {field: 'phone', align: "center", width: '15%', title: '联系方式'},
                    // {field: 'content', align: "center", width: '20%', title: '评估标的信息', search:false},
                    {field: 'create_time', width: '15%', align: "center", title: '创建时间',search: 'range'},
                    {fixed: 'right', width: '20%', align: "center", title: '操作', toolbar: '#barTool'}
                ]
            ],
            page: {}
        });

        yznTable.bindevent();
    });
</script>
{/block}